from time import sleep
from selenium.webdriver.common.keys import Keys
from element import findCssEles


def addPn2Cart(driver):
    # 加入购物车
    driver.implicitly_wait(3)
    searchInput = driver.find_element_by_css_selector(
        '.ant-input-search input')
    searchInput.send_keys('E0000225AC')
    searchInput.send_keys(Keys.RETURN)

    sleep(1)
    findCssEles(driver, '.cart-operater', 1)
    sleep(1)
    findCssEles(driver, '.quick-btns button', 3)
